<?php


namespace app\portal\model;


use think\Model;

class ContestCategoryPostModel extends Model
{
    /**
     * 模型名称
     * @var string
     */
    protected $name = 'contest_category_post';

    public function getCate($id) {
        $categories = $this->alias('a')
            ->join('contest_category b', 'a.category_id = b.id')
            ->where('a.contest_id',$id)
            ->field('a.category_id,b.name')
            ->select()->toArray();
        return $categories;
    }
}